<div class="content-titulo">
    
    <div class="filtro">
        <form id="form_filtro" method="get" action="">
            <i>Filtrar</i>
            <?php 
                //$f_cur = new Sistema_Model_DbTable_Catsegmento();
                //$f_cur = $f_cur->fetchAll('CTS_STA = 1');
                $query = 'SELECT SQL_CACHE CTS_ID,CTS_NOM FROM CATSEGMENTO WHERE CTS_STA = 1 ORDER BY CTS_ORD ASC';
                $f_cur = $this->db->fetchAll($query);
            
                $html = '<select id="filtroseg" name="filtroseg">';
                $html .= '<option value="">Todos Segmentos</option>';
                foreach($f_cur as $r){   
                    $select = $this->filtroseg == $r['CTS_ID'] ? 'selected':''; 
                    $html .= '<option '.$select.' value="'.$r['CTS_ID'].'">'.$r['CTS_NOM'].'</option>'; 
                }
                echo $html .= '</select>';
            ?>
            
            <input type="text" name="dscfiltro" value="<?php echo $this->dscfiltro; ?>" placeholder="Título" />
            
            <input type="submit" class="btn-pdr" name="buscar" value="buscar" />
        </form>
    </div>
    
    <div class="content-btn">
        <a href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'edit')); ?>">+</a>
    </div>
    
    <h2><?php echo $this->titulo;?></h2>
    
</div>

<div class="content-list">
    
<?php foreach ($this->result as $row) { 
//$cts = $row->findDependentRowSet("Sistema_Model_DbTable_Catsegmento")    
?>
    <div class="item" style="height:100px">    
        <div class="col" style="width: 150px">
            <p><strong>Título: </strong><?php echo $row['BAN_DSC']; ?></p>
            <p><strong>Ordem: </strong><?php echo $row['BAN_ORD']; ?></p>
            <p><strong>Status: </strong><?php echo tools::returnStatus($row['BAN_STA']); ?></p>
        </div>
        <div class="col" style="width: 200px">
            <p><strong>Segmento: </strong><?php echo $row['CTS_NOM']; ?></p>
        </div>
        
        <div class="col" style="width: 150px">
            
        </div>
        
        <div class="btn-actions" style="padding-top: 10px;">
            <?php if($this->per_edt){?><a class="btn-pdr" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'edit', 'id' => $row['BAN_ID'])); ?>">Editar</a><?php }?>
        </div>

      </div>
    <?php } ?>
</div>
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>
